# https://gitee.com/yueyinqiu5990/codes-for-tj10053104/blob/master/supplement1/question1/cube.py
from typing import Optional


class Cube:
    def __init__(self, side_a: float, side_b: Optional[float] = None, side_h: Optional[float] = None):
        self._side_a: float = side_a
        self._side_b: float = side_a if side_b is None else side_b
        self._side_h: float = side_a if side_h is None else side_h

    def volume(self):
        return self._side_a * self._side_b * self._side_h

    def surface(self):
        s1 = self._side_a * self._side_b
        s2 = self._side_h * self._side_a
        s3 = self._side_h * self._side_b
        return (s1 + s2 + s3) * 2


def _main():
    side = int(input("输入立方体边长："))
    cube = Cube(side)
    print(f"表面积为 {int(cube.surface())} ；体积为 {int(cube.volume())}")


if __name__ == "__main__":
    _main()
